package com.lrkj.payfee.service.impl;

import java.util.List;
import com.lrkj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lrkj.payfee.mapper.HandAdviceMapper;
import com.lrkj.payfee.domain.HandAdvice;
import com.lrkj.payfee.service.IHandAdviceService;

/**
 * 交班付款明细Service业务层处理
 *
 * @author yajun_ren
 * @date 2022-03-31
 */
@Service
public class HandAdviceServiceImpl implements IHandAdviceService
{
    @Autowired
    private HandAdviceMapper handAdviceMapper;

    /**
     * 查询交班付款明细
     *
     * @param id 交班付款明细ID
     * @return 交班付款明细
     */
    @Override
    public HandAdvice selectHandAdviceById(String id)
    {
        return handAdviceMapper.selectHandAdviceById(id);
    }

    /**
     * 查询交班付款明细列表
     *
     * @param handAdvice 交班付款明细
     * @return 交班付款明细
     */
    @Override
    public List<HandAdvice> selectHandAdviceList(HandAdvice handAdvice)
    {
        return handAdviceMapper.selectHandAdviceList(handAdvice);
    }

    /**
     * 新增交班付款明细
     *
     * @param handAdvice 交班付款明细
     * @return 结果
     */
    @Override
    public int insertHandAdvice(HandAdvice handAdvice)
    {
        handAdvice.setCreateTime(DateUtils.getNowDate());
        return handAdviceMapper.insertHandAdvice(handAdvice);
    }

    /**
     * 修改交班付款明细
     *
     * @param handAdvice 交班付款明细
     * @return 结果
     */
    @Override
    public int updateHandAdvice(HandAdvice handAdvice)
    {
        handAdvice.setUpdateTime(DateUtils.getNowDate());
        return handAdviceMapper.updateHandAdvice(handAdvice);
    }

    /**
     * 批量删除交班付款明细
     *
     * @param ids 需要删除的交班付款明细ID
     * @return 结果
     */
    @Override
    public int deleteHandAdviceByIds(String[] ids)
    {
        return handAdviceMapper.deleteHandAdviceByIds(ids);
    }

    /**
     * 删除交班付款明细信息
     *
     * @param id 交班付款明细ID
     * @return 结果
     */
    @Override
    public int deleteHandAdviceById(String id)
    {
        return handAdviceMapper.deleteHandAdviceById(id);
    }

    @Override
    public int deletehandRecordId(String handRecordId) {
        return handAdviceMapper.deletehandRecordId(handRecordId);
    }

    /**
     * 批量新增交班付款明细信息
     *
     * @param handAdvices 交班付款明细对象
     */
    public int batchAddData(List<HandAdvice> handAdvices)
    {
           return handAdviceMapper.batchAddData(handAdvices);
    }
}
